import request from '@/utils/request'

/**
 *
 * @param {username,status,email,page,limit} data
 * @returns
 */
export function exprotList(params) {
  return request({
    url: 'permission/user',
    params
  })
}

/**
 * 删除管理员
 */
export function delList(id) {
  return request({
    url: 'permission/user/' + id,
    method: 'delete'
  })
}
/**
 * 编辑管理员
 */
export function newcompileList(id) {
  return request({
    url: `permission/user`,
    params: { id }
  })
}

export function changeOption(data) {
  return request({
    url: `permission/user/${data.id}/${data.hidden}`,
    data
  })
}
export function getrole() {
  return request({
    url: 'permission/role'

  })
}
export function getUserDetail(id) {
  return request({
    url: 'permission/user/' + id

  })
}
export function addUser(data) {
  return request({
    url: 'permission/user',
    method: 'post',
    data
  })
}
export function updataUser(data) {
  return request({
    url: 'permission/user/' + data.id,
    method: 'put',
    data
  })
}

